enhanced output and fixed bug at error 0