fix getting metadata