Small fix for removing agent before checking