change beat count and cleanup function