tested for multiple species and added error handling