On crepant resolution of some hypersurface singularities and a criterion for UFD