update and fixed bugs