checking for NPE for inputs and outputs