added script logic