catch null pointer at timeout
re-merging wallet code