Removed the usage of deprecated NSBeginAlertSheet and replaced it with NSAlert for creating alerts