adding alert to function square