added alert dialog, second acitivity defined as dialog