Fixed error when editing the post second time after changing it's type