Fixing error message
Fix to correctly output error message.
Removing deprecated and unused method declaration