fixes build script to create db and start application
adds check for nil