added first if statement