added default case for undefined user

unexpected alert behaviour