removed nil check on chart funciton  -need to fix