Fixed stupid bug causing app to hang