fixing to-from bug