Fixed main handling