Fixed bug where incorrect id was passed to the ajax