changed query to check for ANSNYM