Fixed bug in mf_userloggedin function