more refining of IM and now it works ok from GUI