Added database id validation