Check if the module is in the same context before checking if it is open