Fix Deprecated rais warning code

It seems replaced during adding new feature. :bow: