make sure attributes is array