Fixing NPE

Signed-off-by: Ventsislav Dimitrov <wencislawdimitrow@gmail.com>