Added onPreUpdate