#191 fixed registration bugs