fixed script to work