implemented the decorator function