Added lots of checks