added correct check for remote user vs logged in user