handling different case scenario