fixed a possible exception