better handling of multiple running instances