try-catch not allowed, try to solve some other way