Adding login required middleware