Preventing bid undefined error