Fixed error. Direction should be array