open_with_check is now a real function