merged into one if statement