Got database working with master/detail view