Enabling Master mode, disables client mode

What exactly are you trying to achieve?

If you are trying to use client (sta) mode and AP mode simultaneously with a single radio, the sta mode must connect first because the channel used is dictated by the upstream AP to which the sta mode connection will be made. Therefore, the AP mode operation cannot come up until the sta mode connection has been established. Or, conversely, if you force AP mode, sta mode cannot run.

Meanwhile, the problem that you may encounter is that if the device is unable to establish the upstream connection (i.e. the upstream AP/SSID is not available), the AP mode will never come up at all because of the reason described above. To solve this issue, there is a package called travelmate which allows for a graceful handling of this 'failure.'