Adding the if statement for callback errors