fix bug in crypt