gets id from db