* close spinner in case of unhandled error
* make js lint happy and compare directly with undefined
* formatting