Fixing database script