You did just the right thing. Firstly, skill and hardwork should be recognised and rewarded. Secondly, if they are hiking your salary just because you are leaving, it means they need somebody like you on hand immediately and can pay more; that also means once they get another guy they will show you the way out, and that may well be at a time when you don't have offers on hand. So one cannot rely on such management. Thirdly, there is no point in working in a place with dissatisfaction. We should not stay where we cannot put our heart and soul in. You did the best thing. Hope you would get the right treatment in your new job.