fixing random bug