Added if statement to call method