Added somdatabase access and setup main