I figured it out. It actually worked all the time !!!
The problem was my SQL Viewer Software HeidiSQL (v12.0.0.6468) which has a bug and is not showing new data even after refreshing, you need to close the software and open it again to make it work or respectively close the connection and reopen it.