Added the functionality to take phos when device outside boundary