Correct query call for alerts