fixed incorrect condition