added some error handling and ability to accept multiple values