Pieces of metal (ferrous) near a compass can cause erratic behavior. There is probably nothing wrong with your compass.