Fixed property update function to escape special characters.