added a callback function "onReposition". also some bug fixes