decorator to add authentication and logging fix