fixed error caused by 0 length strings