fixed broken piece of code