modal partly working