~ fixed inproper id handling in sql statement