modified the way to record id and password