diff --git inline_messages.module inline_messages.module
index 2056e5a..8bfd6a7 100644
--- inline_messages.module
+++ inline_messages.module
@@ -111,7 +111,7 @@ function inline_messages_form_alter(&$form, $form_state, $form_id) {
     // there can be multiple forms on the same page, so catch what's submitted
     // if a form is still in progress (aka error, multistep) we can use $form_state
     // after a form is completed we need to use the session variable
-    if ($form_state['post']['form_id'] == $form_id || $_SESSION['form_submitted'] == $form_id) {
+    if ($form_state['post']['form_id'] == $form_id || (isset($_SESSION['form_submitted']) && $_SESSION['form_submitted'] == $form_id)) {
       // add js
       drupal_add_js(array('form_submitted' => str_replace('_', '-', $form_id)), 'setting');
       
