removed else and fixed condition