Add error handling for functions
0.0.5.