Fixed error when pts in db is zero