added append_user function