logic bug fixes