add check for running instance. Fixes #466