swapped if for eq for security reasons