fix key crashing