fixed a acces violation on startup