add require login functionality