fixing error when it not loged