fix a bug when creating ships