Changes return array for query function