ram usage fixes