found bugs in if condition