Removing useless check code