[fix] proper removal of last part of var