updated error message
fixed import path error, updated IsValid function returns error if passed value is invalid