changed package structure
Updated error handling