fixing random bugs