added condition to check params