wrapped results in if clauses to protect against node server crashes