hackish error handling