Revert e2f0522..770d7ba

This rolls back to commit e2f0522dff57e995e12d1c0e51ad4ee67ac69828.
update bug fixed and tested