bugs fixes and archive working