Fixed the bug where preExecuteMain could be execute while execute was already executing

Signed-off-by: Toon Schoenmakers <nighteyes1993@gmail.com>