fixed a small seg fault
added script