moving composer out side of the if statement