changed mergeAttributes to extract proper attributes instead of sending entire __dict__