added move callbacks and fixed non automargin mode