changed database and exceptions catches