fixed bug when gui disabled