found and fixed bugs