better database size checking