added check if file exists

Signed-off-by: Joseph Morse <tamed.lionheart@gmail.com>