added role support and db status checks