fix location bug and missing sys require

Signed-off-by: Itai Koren <itkoren@gmail.com>