fixing all bugs