Fixed bugs in inserting data into user collection