Fixed edit buttons not working correctly