added a if statement