fixing for bugs 16,17,22,23,24