added error handling on distribution