Fixed "null pointer" exception