add attributes prop if undefined