fixed wrong variable usage in getContents()