Updated the decorator to work correctly