plus a little bit of error handling