fix npe issue on save
Reviewer: Dan Jao