fixed encoding
fixed crash while viewing a view which wasn't saved yet