added db transactions
updated script
incorrect db model
fixed users in roles