FIX: call to pointer before making sure that pointer is not nil