added mimetype support and improved setting password