fix bug, add z sort