you need to handle invalid keys properly