fixed double pointer error

need to save on main context