changed code to apply config in an array