fix status codes check. fixes #356