fixed error in command length by switching to startsWith