function doesnt change array values