changed crop yield logic and error handling