Changed if condition to else