1. fix bug in insert of start and end date
2. on register of a new user, update UserHistory table also.

Signed-off-by: Saikat <rychwdh2@illinois.edu>