Changed position of asset directory check and fixed indentation.