database and script working