Added middleware for login required feature