fixing fetching mysql object