Added more code to the if conditional