fixed #233 and fixed #383