I've copied your code and tried to make it work and it worked well.
Link - is the source which I've used. Can you check the code, and review your code again.