note bug
rewrite to fix bug