removed unnecessary getmetadata() call