md5 logic fixed