fix https://github.com/openfl/openfl/issues/365