fixed incorrect modifier check logic