added collision handling for preview