added a toggle function for YCM