adding methods for different kinds of code errors