error rescue and removing nil or empty from location