Trimming the end of variable if it's too long