added default value of active as false, fixed some bugs for logining for ghost user