Added pre and post-update hooks