Change presense to length condition in if