adds error handling and stops using submitted?