Removing unnecessary if check for error