Small fix for error handlings