added clear(nullObject) in the catch for older mobile browsers