should change the arg name from 'metadata' to 'attributes' also