Fixed bug in if condition.