more attempts at bug fixing