Fixed small sql error that ould occur of id is not found