clearAndType method updated for MAC os