handled error values better