Arduino behaving differently connected vs disconnected

and im using a 9v to power everything

A nine volt what? A battery? a AC power adaper (wall wart)? What is the current capacitor of your 9v whatever?

To properly power your project you should research the max current requirements of all the components it is using, and only then do you have the proper information (total current demand) to go about figuring out how to power everything. I have do doubt that power (lack of current capacity) is the root cause of your problem(s).

Lefty