working registration and mongo persistence