Modified query result handler