fixed almost all bugs expect time