Added functionality to respond to updates in database