fix "Cannot call method 'valueOf' of null"