Verifications

Added verifications and error handling