migrated javascript from assign page