disable gc + using try/catch instead of if/else condition