corrected to use action as parameter