cleaned up error. Still some mess