fixing deprecation warnings in models