adding more changes to middleware'
removed false check in middleware