Fix undefined js variable when updating post from profile