added do block in if statement