function can throw exception