fix error code detection
do not start another instance if already running