remove test code and fix the issue with edit