fixed bug about if block