Extra error handling, just in case.