fixing some issues with the previous version