fixed a null pointer exception for style sheets