Added database call to find next lowest possible filename