correcting database build if directly is empty