fixed up database get ranged issues