BUG: fix if() statements errors