added return to if statement branch