backend update to handle query