edit bug and sql