Changed update to use prepared statements