fix a bug on async open error handling -> check if there is some function to avoid call to undefined object