Fixing issue with alert messages