some fixes in the code