added proper deffered stuff, upgraded to 2.7