fixed sloppy code