auto close ycm and added dispatch