fix bug with passing by id