invered logic to disable ap/mesh (more safe), added missing conditions