fix bug by alan