bugfix and removing extraneous spaces