preventing key error