MHAPI missed one if condition - fixed