This code shouldn't be in the else block, as far as I can tell... Otherwise it would not be reached when running on desktop.