create plugin function and set defaults