fixing bug matt found