Fixing wrong pass condition