added logging and handling errors during parsing metadata