fixed a bug with invalid target