Not able to execute kubectl command in rancher right project

I am trying to execute a kubectl command to create secret in a non default project of rancher with the help of rancher CLI.

Command to choose the project

rancher context switch

rancher kubectl apply -f secret.yml //to create secret

but still secrets are getting created in default project.