fixing random errors popping up