alert working correctly