fixing bugs in metadata block