throwing correct error message when execution context is missing