bug in condition fixed