Use die function instead of boring if else everywhere.