better checks for execution context