adding function for throttle