added posibility to pass config as array