changed to generic exeptions