hopefully fixed bugs #2