several changed done in order to make it work.