bug fixes, look at my comment