fixed null pointer exception and improper parameters.