Fixed Dan's bug