fixed an edge condition