Retrive data from table no working correctly