Fixed big performance bug