fixed bug i introduced by removing code