sorted out order bug