fixed a broken piece of code