Fix for not correct deleting studies