completes run and stop functions