Added error code exit