changed database name to database.sqlite
fixed wrong variables in sync()