Fixed restart bug (in a VERY  ugly way)