Creating a basic middleware