added edit button and fixed some edit bugs