CAdded some checking condition