fixed empty database issue