added some error handling and favorite session