add #! to every python file, fix mark grid index out of range