Replace whole array not just first element