fix fime mode and add back hashbang
fix null type and use correct script id
only attempt 3 times to get script source