error handling in case of empty receipients
improved documentation and error handling