port for 1.4.7
moved and fixed