Code refactoring issue

fixes the issue introduced in: https://github.com/browserstack/browserstack-runner/commit/b391aa155a2c77298c0993f42036161ce685c7e3