Adding exception for missing parameter
Fixing errors