add msgbox. fixed bugs