error in sample js