fixing bug with wrong endpoint