Fix for Error 10 app crash