fixing the buggy magic