Added the correct functionailty with charts