Changed the sql statement from update to insert