setup logic for minimize at start to work