Query not sending right data fix