database mapper working