added span and some fixes