Moved engine creation inside try-catch