Bugfix status codes and check on status code