fix spawn bug