prevent keyerror