added dynamic stop function

Signed-off-by: Sean Nicholls <seannicholls@gmail.com>