Fixed issue with id selection on db adapter